#pragma once

#include <QHash>
#include <QString>
#include <QtCore/QVariant>
#include <QStringList>
#include <QtCore/QObject>

class AppModuleOpt : public QObject
{
	Q_OBJECT
public:
	AppModuleOpt() : m_IsSwitched(true) {}
	virtual ~AppModuleOpt();

	virtual void putProp(const QString& prop,const QVariant& var,bool sendSignal = false);
	
	virtual QVariant getProp(const QString& prop) const {
		return m_PropTable.value(prop);
	}

	void setSwitchState(bool b) {
		m_IsSwitched = b;
	} 

	bool getSwitchState() const {
		return m_IsSwitched;
	}

	void clear() {
		m_PropTable.clear();
	}

	void sendOptChangedSignal() {
		emit moduleOptChanged();
	}

	QStringList getKeys() const;

signals:
	void moduleOptChanged();

private:
	QHash<QString,QVariant> m_PropTable;
	bool m_IsSwitched;
};